<?php

class template_listing extends theme
{

	protected function head()
	{
	?>
<!--[if IE]>
<script type="text/javascript" language="javascript" src="../js/excanvas.compiled.js"></script>
<![endif]-->
<script type="text/javascript" language="javascript" src="../js/jquery.bt.min.js"></script>

<link type="text/css" rel="stylesheet" href="apps/app/templates/default/css/listing.css" />
<script type="text/javascript" language="javascript" src="apps/app/templates/default/js/listing.js"></script>
	<?php
	}
	
	protected function center()
	{
		$apps = $this->get('apps');
		?>

		<table class="list-table">
		
		<thead>
		<tr>
			<th width="130">缩图图</th><th>名称/描述</th><th width="200">作者</th><th width="30">删除</th>
		</tr>
		</thead>
		
		<tbody>
		<?php 
		if(count($apps))
		{
			foreach($apps as $app)
			{
			?>
			<tr id="row-<?php echo $app->id; ?>"  onMouseOver="this.className='row-on'" onMouseOut="this.className='row-off'">
			<td align="center">
				<div class="app-thumbnail" title="<?php echo $app->image; ?>">
					<img src="<?php echo $app->thumbnail;?>" width="120" height="90">
				</div>
			</td>
			<td valign="top"><div class="app-name"><?php echo $app->name;?></div><?php echo $app->description;?></td>
			<td>
				<?php
				echo '<strong>'.$app->auther.'</strong><br /><p>'.$app->auther_email.'<br />';
				if($app->auther_website) echo '<a href="'.$app->auther_website.'" target="_blank">'.$app->auther_website.'</a>';
				echo '</p>';
				?>
			</td>
			<td align="center">
			<?php if($app->app_id>1024){ ?>
			<a href="javascript:;" onclick="javascript:deleteApp(<?php echo $app->id; ?>)" class="delete"></a>
			<?php } ?>
			</td>
			</tr>		
			<?php
			}
		}
		else
		{
		?>
		<tr>
			<td colspan="7">没有记录</td>
		</tr>
		<?php
		}
		?>
		</tbody>
		
		<tfoot>
		<tr>
			<td colspan="7"><?php $this->pagination(); ?></td>
		</tr>
		</tfoot>
		</table>

		<?php
		
	}	

}
?>